<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/common.jsp"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
  <head>
   <title>系统公告管理</title>
   <%@ include file="/common/meta.jsp"%>   
   <link href="<c:url value='/styles/main.css'/>" type="text/css" rel="stylesheet">   
<link href="<c:url value='/widgets/ext/css/ext-all.css'/>" type="text/css" rel="stylesheet">
<script src="<c:url value='/widgets/ext/scripts/ext-base.js'/>" type="text/javascript"></script>
<script src="<c:url value='/widgets/ext/scripts/ext-all.js'/>" type="text/javascript"></script>
<script src="<c:url value='/widgets/ext/scripts/miframe.js'/>" type="text/javascript"></script>
<link href="<c:url value="/widgets/extremecomponents/extremecomponents.css"/>" type="text/css"  rel="stylesheet"/>
	<script type="text/javascript" src='<%=contextPath%>/dwr/interface/afficheService.js'></script>
	<script type="text/javascript" src='<%=contextPath%>/dwr/engine.js'></script>
	<script type="text/javascript" src='<%=contextPath%>/dwr/util.js' /></script>
	<script type="text/javascript">
  function addAffiche(){  
  	openPop("affiche.do?method=add","新信息",480,320);  	
  }
  
  function editAffiche(id){
  	openPop("affiche.do?method=edit&id="+id,"编辑配置信息",480,320);
  }
  
  function deleteAffiche(id){
  	if(window.confirm("确定要删除记录吗？"))
  	{  		
  		afficheService.deleteAfficheById(id,function(reply){ajaxSubmit(reply,"删除成功!","reload");});
  	}else{
  		return false;
  	}
  }
</script>
</head>
 <body bgcolor="#F2FEF4">
		<div id="detailheader">
			<img src="<%=request.getContextPath()%>/images/main/main_ban01Dot.png" />
			<div>系统公告管理</div>
		</div>
		<html:form action="affiche.do?method=search" method="get">
			<div id="timecote">	
				<div id="timel"></div>			
				<div id="timem">
					<table cellspacing="5px">
						<tr>
							<td align="left">类型:
								<html:select property="affichePo.type">
									<html:option value="0">公告</html:option>
									<html:option value="1">新闻</html:option>
									<html:option value="2">通知</html:option>
									<html:option value="3">紧急通知</html:option>	
								</html:select>
							</td>
							<td align="left">
								标题:<html:text property="affichePo.title" />
							</td>
							<td align="left">
								有效天数:<html:text property="affichePo.validDays" />
							</td>
							<td><html:submit styleClass="btn_Xp_Bg0" value="查询" /></td>							
						</tr>
					</table>
				</div>
				<div id="timer"></div>
			</div>
			<div style="text-align:right;padding:5px">
				<input type="button" class="btn_Xp_Bg0" value="新增" onclick="addAffiche()"/>
			</div>
			<div id="tbcontent">
				<ec:table items="resultList" var="rs" form="afficheForm"
					action="${pageContext.request.contextPath}/affiche.do?method=search"
					title="公告信息" retrieveRowsCallback="limit"
					sortRowsCallback="limit" width="95%">
					<ec:row>
						<ec:column property="0" title="标题">
							<c:out value="${rs.title}" />
						</ec:column>
						<ec:column property="1" title="类型">
							<c:out value="${rs.type}" />
						</ec:column>							
						<ec:column property="2" title="有效天数">
							<c:out value="${rs.validDays}" />
						</ec:column>
						<ec:column property="3" title="创建用户">
							<c:out value="${rs.opName}" />
						</ec:column>
						<ec:column property="4" title="创建时间">
							<c:out value="${rs.opDatetime}" />
						</ec:column>
						<ec:column property="5" title=" ">
							<a href="#" onclick="editAffiche(<c:out value='${rs.afficheId}'/>);return false">编辑</a>
						</ec:column>
						<ec:column property="6" title=" ">
							<a href="#" onclick="deleteAffiche(<c:out value='${rs.afficheId}'/>);return false">删除</a>
						</ec:column>
					</ec:row>
				</ec:table>
			</div>
		</html:form>		
	</body>
</html>
